package com.gok.pay.rest;

import com.gok.model.pay.PayOrder;
import com.gok.pay.service.ITestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by zhuwenquan on 2017/12/27 0027.
 */
@RestController
@Slf4j
public class TestRest extends AbstractBaseRest {
    @Resource
    private ITestService testService;
    /**
     * 测试方法，查看该controller是否可以正常访问
     * @return
     */
    @RequestMapping(value = "/public/test", method = RequestMethod.GET,produces = APPLICATION_JSON_UTF8_VALUE)
    @ResponseBody
    public ResponseEntity test() {
        System.out.println("user test method....");
        log.info("user test method....");
        PayOrder payOrder = testService.createPayOrder();
        testService.updatePayOrder(payOrder);
        List<PayOrder> orderList = testService.selectPayOrder();
        log.error("user test method....");
        return successObject(orderList);
    }
}
